/* --- Global Styles --- */
body {
    background: url('/static/dlminzu.jpg') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    color: #333;
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* --- Layout --- */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #1e3a8a, #1c3faa);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
}

.sidebar-header {
    padding: 0 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-header i {
    font-size: 24px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li a {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    padding: 15px 25px;
    color: #e0e0e0;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: #1976d2;
}

.sidebar li.active a {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    border-left-color: #4dabf7;
}

.sidebar li a i {
    width: 20px; /* For alignment */
    text-align: center;
}

.main-content {
    margin-left: 250px; /* Same as sidebar width */
    padding: 40px;
    flex: 1;
}

.content-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.content-card h2 {
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8em;
}

/* --- Form Styles --- */
input[type=text], input[type=password], input[type=number], input[type=date], select {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.form-row input {
    flex: 1;
    margin-bottom: 0; /* Override default margin */
}

/* --- Button Styles --- */
button, .button, a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
}

button:hover, .button:hover, a.button:hover {
    background: #145ea8;
    transform: translateY(-1px);
}

/* --- Table Styles --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

th, td {
    border-bottom: 1px solid #eee;
    padding: 16px;
    text-align: left;
}

th {
    background: #f9fafb;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f7fafd;
}

/* --- Flash Messages --- */
.flash {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid transparent;
}
.flash.success {
    color: #2b6b2d;
    background-color: #d6f0d7;
    border-color: #a1d9a3;
}
.flash.error {
    color: #8c2c26;
    background-color: #f8d7da;
    border-color: #f2b0b6;
}

/* --- Balance Page Specific Styles --- */
.info-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 20px; }
.info-block { display: flex; align-items: center; gap: 16px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: #e8effe; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #1976d2; }
.account-info { font-size: 16px; color: #333; }
.account-info strong { color: #1e3a8a; }
.status { color: #388e3c; font-weight: bold; }
.balance-label { color: #555; font-size: 16px; margin-bottom: 8px; }
.balance-value { font-size: 38px; color: #1e3a8a; font-weight: 700; letter-spacing: 1px; margin-bottom: 16px; display: flex; align-items: center; }
.balance-currency { font-size: 22px; color: #1976d2; margin-right: 8px; }
.update-time { color: #777; font-size: 14px; margin-top: 24px; text-align: right; }

/* --- Login/Menu Page Styles (No Sidebar) --- */
.container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card, .menu-card {
    width: 100%;
    max-width: 450px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
    padding: 40px;
    text-align: center;
}

.login-card h2, .menu-card h2 {
    font-size: 2em;
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 30px;
}

.login-card .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.login-card input {
    margin-bottom: 0;
}

.menu-card ul {
    list-style: none;
    padding: 0;
    margin: 30px 0;
}

.menu-card li {
    margin: 15px 0;
}

.menu-card .button {
    width: 100%;
    box-sizing: border-box;
}

.login-tabs {
    display: flex;
    margin-bottom: 25px;
}

.login-tabs input[type="radio"] {
    display: none;
}

.login-tabs label {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #555;
    background: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

.login-tabs label:first-of-type {
    border-radius: 8px 0 0 8px;
}
.login-tabs label:last-of-type {
    border-radius: 0 8px 8px 0;
}

.login-tabs input[type="radio"]:checked + label {
    background: #e8effe;
    color: #1976d2;
    border-bottom-color: #1976d2;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.login-card .button {
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.flash-messages {
    margin-top: 20px;
    width: 100%;
}

/* 卡片和主要内容加白色半透明遮罩增强可读性 */
.card, .main-content, .container, .content {
    background: rgba(255,255,255,0.92) !important;
    box-shadow: 0 2px 12px #e3eaf2;
} 